import request from '@/utils/request'

/**
 * 获取企业列表
 * @param { page, pageSize} params
 * @returns
 */
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}

export function getIndustryListAPI() {
  return request({
    url: '/park/industry',
    method: 'GET'
  })
}

// 上传
// const fd = new FormData()
// fd.append('file', 选择的文件)
// fd.append('type', 'businessLicense')
// uploadAPI(fd)

// uploadAPI({ file: 选择的文件, type: 'businessLicense' })

export function uploadAPI(obj) {
  return request({
    url: '/upload',
    method: 'POST',
    data: obj
  })
}

export function addEnterpriseAPI(obj) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data: obj
    // params: {}
  })
}

export function getEnterpriseDetailAPI(id) {
  return request({
    url: '/park/enterprise/' + id,
    method: 'GET'
  })
}

export function editEnterpriseAPI(obj) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data: obj
  })
}

export function delEnterpriseAPI(id) {
  return request({
    url: '/park/enterprise/' + id,
    method: 'DELETE'
  })
}
